package com.probiz.estore.common.service.impl;

import java.util.ArrayList;
import java.util.List;

import com.probiz.estore.Constants;
import com.probiz.estore.common.model.system.PaymentMethod;
import com.probiz.estore.common.service.PaymentMethodService;
import com.probiz.estore.system.service.PaymentMethodManager;
/**
 * @deprecated V3.5将删除，小模块不需要提供service接口
 *
 */
public class PaymentMethodServiceImp implements PaymentMethodService {

	private PaymentMethodManager paymentMethodManager;
	
	public void setPaymentMethodManager(PaymentMethodManager paymentMethodManager) {
		this.paymentMethodManager = paymentMethodManager;
	}

	public List<PaymentMethod> getPaymentMethodByCart(boolean isVirtual) {
		/*SearchCriteria sc = new SearchCriteria();
		sc.setHql("from PaymentMethod where status=1 order by paymentMethodId desc");
		List<PaymentMethod> list = paymentMethodManager.searchByCriteria(sc);
		if(!isVirtual)
			return list;
		else{
			List<PaymentMethod> l = new ArrayList<PaymentMethod>();
			for(PaymentMethod m : list){
				if(m.getIscod()==0)
					l.add(m);
			}
		    return l;
		}*/
		
		return null;
	}
	
	

	public List getPaymentMethodsOnline() {
		List list = this.paymentMethodManager.getByPaymentMethodTypeStatus(PaymentMethod.PAYMENT_METHOD_TYPE_ONLINE, Constants.STATUS_ACTIVE);
		return list == null ? new ArrayList() : list;
	}

	public PaymentMethod getPaymentById(Integer id) {
		return paymentMethodManager.getById(id);
	}

}
